package com.freecloud.whispered.oss.service;

import com.freecloud.framework.service.InterfaceBaseService;
import com.freecloud.whispered.oss.entity.SysOssEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;

/**
 * @Author: maomao
 * @Date: 2019-07-31 09:44
 */
public interface SysOssService extends InterfaceBaseService<SysOssEntity,Long> {

    List<SysOssEntity> queryUserFileList(Map<String, Object> map);

    SysOssEntity uploadFile(String path) throws URISyntaxException, IOException;

    SysOssEntity uploadFile(String path,boolean isSaveLocalOss)throws URISyntaxException, IOException;

    //void certificateOCR(UserOssEntity obj);

    /**
     * 保存上传的文件
     * @param multFile
     * @param path
     * @return
     */
    File saveLocationFile(MultipartFile multFile, String path);

    File saveLocationFile(MultipartFile multFile);

    /**
     * 获取网络图片，并下载到本地，返回file对象
     * @param urlPath
     * @return
     */
    File getImageFile(String urlPath);


    /**
     * 保存上传文件
     * @param file
     * @param params
     * @return
     */
    Object saveUploadFile(Object file,Map<String, Object> params,boolean isLocal) throws IOException;
}
